package com.hnust.controller;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;

/**
 * 创建人：zhangRuWang
 * 创建时间：2021/5/12
 * 描述：
 */
public class Main {
    public static void main(String[] args) throws IOException {
        JEditorPane s=new JEditorPane(new URL("https://www.baidu.com"));
        s.setSize(10000,1000);
        BufferedImage bufferedImage=new BufferedImage(s.getWidth(),s.getHeight(),BufferedImage.TYPE_INT_RGB);
        SwingUtilities.paintComponent(bufferedImage.getGraphics(),s,new JPanel(),0,0,bufferedImage.getWidth(),
                bufferedImage.getHeight());
        ImageIO.write(bufferedImage,"png",new File("D://output.png"));

    }
}
